<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 查看退货申请明细
     */
	<shiro:hasPermission name="back_gotoReturnsApplyPage_lookLog">
    function checkReturnsApplyDetail() {
        /**获取选中行的id**/
        var selectedRow = $("#tt").bootstrapTable('getSelections');
        if (selectedRow.length == 1) {
            $("#btn_checkReturnsApplyDetail").attr("data-target", "#checkReturnsApplyDetailModal");/**选中了记录后才可打开对应的模态框**/
            $.ajax({
                type: "POST", dataType: "JSON",
                url: "${basePath}/back/returnsApply/getReturnsApplyOPLogList.sjson",
                data: {returnsApplyId:selectedRow[0].returnsApplyNo},
                success: function(data){
                    if(data != null){
                        var strHtml = "<tr><td align='center' style='font-weight:bold'>操作时间</td><td align='center' style='font-weight:bold'>操作人</td><td align='center' style='font-weight:bold'>内容</td></tr>";
                        $(data.returnsApplyOPLogList).each(function(i){
                            strHtml+="<tr><td align='center' >"+this.operatorTime+"</td><td align='center'>"+this.operatorName+"</td><td align='center'>"+this.comments+"</td></tr>";
                        });
                        $("#detailOPLogWinHtml").html(strHtml);
                    }
                }
            });
        }else {
            $("#btn_checkReturnsApplyDetail").attr("data-target", "");/**没有选中记录不可打开模态框**/
            showMsg("请选择一行记录！");
        }
    }
	</shiro:hasPermission>
</script>

<!--查看退货申请明细模态框（Modal） -->
<div class="modal fade" id="checkReturnsApplyDetailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">查看退货申请明细</h5>
			</div>
			<div class="modal-body">
				<table id="detailOPLogWinHtml" align="center" class="addOrEditTable" style="width:700px;"></table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>
